<div ng-controller="scoreShopSearchValueCtrl
">
    <style>
        table td,table th{vertical-align: middle;height: 50px;text-align: center;font-size: 14px;}
        #scoreBody table{ width:80%; align-content: center}
        #scoreBody table th{font-weight: normal}
        #scoreBody table td{vertical-align: middle}
    </style>
    <div class="form-group" style="margin-top: 20px;">

        <form><label class="control-label">小区名称：</label>
        <select ng-options="m.objId as m.communityName for m in communityList.data" ng-model="input.communityName" id = "option_xq" required ng-change = 'getGoodsList(input.communityName)'>
            <option value="">-- 请选择 --</option>
        </select>
        <span style="margin-left: 20px;">用户昵称：<input type="text" ng-model="input.userName" required></span>
        <!--<span style="margin-left: 20px;">去除400小号：<input type="checkbox" /></span>-->
        <button style="margin-left: 20px;" type="submit" class="btn-primary btn-sm  " ng-click="getAtList(input)">搜索</button>

            <a class="btn btn-secondary" href="/#/addScore" style = "margin: -5px 0 0 20px;padding: 5px 8px;border-radius: 4px;">用户加分</a>
        </form>
    </div>

    <div class="tab-content">
        <div class="tab-pane active" id="tab_a">
            <paging>
                <ul class="pagination" num-pages="tasks.pageCount" current-page="tasks.currentPage"
                    on-select-page="selectPage(page)">
                    <li ng-class="{disabled: noPrevious()}"><a href="javascript:;" ng-click="selectPrevious()">&laquo;</a>

                    </li>
                    <li ng-repeat="page in pages" ng-class="{active: isActive(page)}"><a
                            ng-click="selectPage(page)">{{page}}</a>

                    </li>
                    <li ng-class="{disabled: noNext()}"><a ng-click="selectNext()">&raquo;</a>

                    </li>
                    <li ng-show="currentPage>6"><a ng-click="selectPage(1)">首页</a>

                    </li>
                </ul>
            </paging>
            <table class="table table-condensed">
                <thead>
                <tr>
                    <th>小区名称</th>
                    <th>用户id</th>
                    <th>用户昵称</th>
                    <th>手机号码</th>
                    <th>单元</th>
                    <th>房号</th>
                    <th>总积分</th>
                    <th>已使用积分</th>
                    <th>剩余积分</th>
                    <th>明细</th>
                </tr>
                </thead>
                <tbody>
                <tr ng-repeat="result in resultList">
                    <td>{{result.community.communityName}}</td>
                    <td>{{result.objId}}</td>
                    <td>{{result.nickName}}</td>
                    <td>{{result.mobilePhone}}</td>
                    <td>{{result.roomUnit?result.roomUnit:""}}</td>
                    <td>{{result.roomNumber}}</td>
                    <td>{{result.totalValue}}</td>
                    <td>{{result.totalValue - result.currentValue}}</td>
                    <td>{{result.currentValue}}</td>
                    <td> <button type="button" class="btn-primary btn-sm" ng-click="showScoreDetails(result)">查看明细</button></td>
                </tr>
                </tbody>
            </table>
        </div>
    </div>

    <div class="modal fade" style="" id="scoreDiv" tabindex="-1" role="dialog" aria-labelledby="helpModalLabel"
         aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                            aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title">用户情值的明细：</h4>
                </div>
                <div id="scoreBody" class="modal-body">
                    小区名称 : <span id="communityName"></span><br>
                    用户ID : <span id="userID"></span><br>
                    用户名称 : <span id="userName"></span><br>

                    <table class="table table-condensed">
                        <thead>
                        <tr>
                            <th>类型</th>
                            <th>时间</th>
                            <th>原因</th>
                            <th>情值</th>
                        </tr>
                        </thead>
                        <tbody>
                        <!--<tr>-->
                            <!--<td id="type"></td>-->
                            <!--<td id="timing"></td>-->
                            <!--<td id="reason"></td>-->
                            <!--<td id="value"></td>-->
                        <!--</tr>-->
                        <tr ng-repeat="score in scoreList">
                            <td>{{score.change_type}}</td>
                            <td>{{score.time}}</td>
                            <td>{{score.change_reason}}</td>
                            <td>{{score.change_value}}</td>
                        </tbody>
                    </table>
                </div>
                <div class="modal-footer">
                    <button type="button"
                            class="btn btn-default btn-sm" data-dismiss="modal">关闭
                    </button>
                </div>
            </div>
        </div>
    </div>


</div>

